Skip to main content

exists

Type

function

Summary

Returns true if the specified object exists, false if it does not.

Syntax

exists(<object>)

Description

Use the exists function to make sure an object exists before you try to perform an action on it, or to determine whether to create an object.

To find out whether any of a certain type of object exist, use the exists function with the number 1. For example, exists(image 1) returns true if there are any images on the current card, and false otherwise.

You can also specify a chunk of a container, but in this case the exists function always returns true.

tip

To find out whether a file or folder exists, or whether a process is running, use the there is a operator.

Parameters

NameTypeDescription

object

Any object reference.

Examples

exists(card field 1)
exists(button "OK" of card "Preferences")

control structure: function

function: isNumber

glossary: folder, current card, return, process, object

keyword: file

object: image

operator: there is a, there is no

property: owner

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?